GXContainsShape
You can use theGXContainsShape
function to determine if the area covered by a shape contains the area covered by another shape.
gxBoolean GXContainsShape(gxShape container, gxShape test);
container
- A reference to the shape to test as the container.
test
- A reference to the shape to test for inclusion.
- function result
- A Boolean value indicating whether the container shape contains
the test shape.DESCRIPTION
TheGXContainsShape
function returnstrue
as its function result if the shape specified by thecontainer
parameter contains the shape specified by thetest
parameter, and returnsfalse
otherwise.This function may return
true
even if the container shape and the test shape share one or more edges; it returnstrue
if they are the same shape.This function considers the shape fill, the style modifications, and the transform mapping of the container and test shapes. Only areas that are drawn are considered when determining whether the container shape contains the test shape.
The container shape must have one of the solid shape fills (even-odd, winding, inverse even-odd, or inverse winding). The test shape may have any shape fill.
If the test shape has a framed shape fill, this function returns
true
if the frame lies entirely within the area of the container shape, or along the edges of the container shape. As a result, a solid shape contains its own frame.If you provide a test shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape type Action taken bitmap Compares bounding rectangle of bitmap picture Posts the error illegal_type_for_shape
text Converts to path shape glyph Converts to path shape layout Converts to path shape ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil illegal_type_for_shape (debugging version) shape_operator_may_not_be_a_picture (debugging version) SEE ALSO
For examples using this function, see "Determining Whether One Shape Contains Another" beginning on page 4-58.For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.
For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.
For a discussion of transform mappings, see the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.
To determine if a rectangle contains a shape, use the
GXContainsBoundsShape
function, described on page 4-101.To determine if one shape touches another, use the
GXTouchesShape
function, described on page 4-98.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help